<template>
    <div class="set_notice">
        <title-back title="公告设置"></title-back>
        <div class="dis-flex project-notice">
            <p>项目公告：</p>
            <div class="rich_text">
                <i-quill v-model="notice.test" :min-height="400" />
            </div>
        </div>
        <div class="dis-flex attachment_uploading">
            <p>附件上传：</p>
            <div class="files_upload">
                <p v-for="(item,index) in notice.files" :key="index">
                    <span>{{item.title}}</span><a>删除</a>
                </p>
                <Upload action="//jsonplaceholder.typicode.com/posts/">
                    <a>上传附件</a>
                </Upload>
            </div>
        </div>
        <div class="dis-flex publish">
            <p>预发布时间：</p>
            <div class="files_upload">
                <DatePicker type="date" placeholder="日期" style="width: 140px;margin-right:20px;"></DatePicker>
                <TimePicker format="HH:mm" type="time" placeholder="时间" style="width: 118px"></TimePicker>
            </div>
        </div>
        <div class="dis-flex btn_wapper">
            <p style="width: 80px"></p>
            <div class="btn">
                <button @click="save">保存</button>
                <button @click="back">返回</button>
            </div>
        </div>
    </div>
</template>

<script>
    import titleBack from "../../common/title_back.vue"
    import iQuill from '@/components/quill'
    export default {
        components: {
            titleBack,
            iQuill
        },
        data () {
            return {
                notice: {
                    test: "",
                    files: [
                        {
                            title:"公告文件1.doc"
                        },
                        {
                            title:"公告文件2.pdf"
                        }
                    ],
                    time: {}
                }
            }
        },
        methods: {
            // 保存
            save() {
                console.log(this.notice.test)
            },
            back() {
                this.$router.go(-1)
            }
        }
    }
</script>

<style lang="less" scoped>
.set_notice {
    padding: 0 15px 20px 15px;
    .project-notice {
        .rich_text {
            border: 1px solid #ccc;
        }
    }
    .attachment_uploading {
        margin-top: 20px;
    }
    .publish {
        margin-top: 20px;
    }
    .btn_wapper {
        margin-top: 20px;
        .btn {
            button {
                width: 165px;
                margin-right: 20px;
            }
        }
    }
}
</style>